Release 10.1A: OpenEdge Development:
Web Services


Using a User-defined Function

The invocation for a user-defined function contains no information about its mapping to a Web service operation or remote user-defined function. Thus, for a user-defined function invocation, you must first forward reference a prototype mapped to the appropriate Web service procedure handle definition, exactly as you do for a remote user-defined function prototype mapped to a Web service proxy procedure handle.

This is the general syntax for the forward reference to a function prototype:

Syntax
FUNCTION operationName [ RETURNS ] dataType  
  [ ( parameter [ , parameter ] ... ) ] 
  IN hPortType . 

This statement invokes a Web service operation with the specified name (operationName) defined in the port type mapped to the specified procedure object handle (hPortType), passing any parameters with data types specified in the order they are defined for the operation by the WSDL Analyzer, and passing the operation return parameter with the corresponding data type (dataType).

This is the syntax for simple invocation of one user-defined function in a single statement, the same for both Web service operations and user-defined functions:

Syntax
return = operationName [ ( parameter [ , parameter ] ... ) ] . 

This statement invokes a user-defined function with the specified name (operationName), passing any parameters with data types specified in the order they are defined for the operation by the WSDL Analyzer, and passing the operation return parameter as the value of the function, which is assigned to a variable of compatible data type. As with any function, you can invoke it in any 4GL statement where you need to use its value. However, you can only invoke a Web service user-defined function synchronously. For complete information on the FUNCTION statement prototype syntax, see OpenEdge Development: Progress 4GL Reference .


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095